<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<%@ page contentType="text/html; charset=utf-8"%>
	<%@ include file="/commons/taglibs.jsp"%>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<title>平台类型管理</title>

		<%@ include file="/commons/css_js_head.jsp"%>
		<script type="text/javascript">
//复写Url
doListUrl = "${ctx }/base/userapplytypeAction!doList.ts";
doAddBeforeUrl = "${ctx }/base/tsOptionsAction!doFindById.ts?code=${code}";
doUpdateBeforeUrl = "${ctx }/base/userapplytypeAction!doFindById.ts?code=${code}";
doDelUrl = "${ctx }/base/userapplytypeAction!doDelete.ts?code=${code}"
//添加之前
function doAddBefore() {
	var _form = document.forms[0];
	if (doAddBeforeUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}

	_form.action = doAddBeforeUrl;
	_form.submit();
}

//更新之前 
function doUpdateBefore(pkId) {
	var _form = document.forms[0];
	if (doUpdateBeforeUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}
  
	//_form.action = doUpdateBeforeUrl + "&theIdapply=" + pkId;
	//_form.submit();
	
	tb_show("update","${ctx }/base/userapplytypeAction!doFindById.ts?code=${code}&theIdapply="+ pkId+"&keepThis=true&TB_iframe=true&width=700&height=350&modal=true",false);
}

//删除
function doDel(pkId) {
	var _form = document.forms[0];
	if (doDelUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}
		if(confirm("确定删除?"))
		{  
		    	_form.action = doDelUrl + "&theIdapply=" + pkId;
			_form.submit();
			return true;
		}
		return false;

}

function doQueryNameAndOption(){
	
}

function isDel(flag){
	if(flag =="No"){
		alert('该类型已添加应用平台');
	}
	
}
</script>


	</head>
	<body style="overflow-x: hidden" onload="isDel('${isDelete }')">

		<!-- 标题 -->
		<div class="mTitle">
			<span class="hidsearch"><a href="javascript:void(0)"
				onClick="return chg('searchList');" id="ImgArrow"> <img
						src="${ctx}/images/icon_up.gif" id="imgButton" />
			</a> </span>
			<b class="bbig">应用平台类型管理</b>
			<a href="${ctx }/base/userapplytypeAction!doFindById.ts" onclick="" >增加选项</a>
		</div>

		<!--list -->
		<div class="searchBar" id="searchList" style="display: block;">
			<form action="${ctx }/base/userapplytypeAction!doList.ts" method="post">
			<!-- 
			<s:hidden name="options.code"></s:hidden>
			 -->
				<table class="searchTable">
					<tr>
						<th>
							名称：
						</th>
						<td>
							<s:textfield name="name" theme="simple"></s:textfield>
						</td>
						<th>类型</th>
						
						<td>
						     <s:select
                                 theme="simple"
                                 name="optionId"
                                 list="#request.list" 
                                 cssStyle="width:83px;"	
                                 listKey="theId" 
                                 listValue="name"
                                 headerKey=""
                                 headerValue="请选择类型"
                			     id="select">
							</s:select>
						</td>
						
						
						<td>
							<input name="btn_query" type="button" class="btn" value="查询"
								onclick="doQuery()" />
							
						</td>
					</tr>
				</table>
			</form>
		</div>
		<div class="mainList">

			<table class="listTable">
				<tr>
					<th>序号</th>
					<th>
						名称
					</th>
					
					<th>
						类型
					</th>
					<th>
						操作
					</th>
				</tr>
				

				<c:forEach var="userapplytype" varStatus="status" items="${pager.data}">
					<tr align=center>
						<td>${status.index+1} </td>
						<td>
							${userapplytype.name}
						</td>
						
						<td>
							${userapplytype.optionName }
						</td>
						
						
						<td>
							<a href="javascript:void(0)"
								onclick="javascript:doUpdateBefore('${userapplytype.theIdapply}');"><span
								class="icon_edit">&nbsp;</span>修改</a>
							<a href="javascript:void(0)" onclick="javascript:doDel('${userapplytype.theIdapply}');"><span
								class="icon_del">&nbsp;</span>删除</a>
								
						</td>
					</tr>
				</c:forEach>
			</table>
		</div>
		<!--end list -->

		<!-- 分页区域  -->
<%@ include file="/page/pager.jsp"%>

<script type="text/javascript">
ajaxAnywhere.formName = "form1";
ajaxAnywhere.getZonesToReload = function() {
    return "zoneList";
}
</script>

	</body>
</html>
